import { AxiosOperator } from '../infrastructure/axios_operator'
import { UserApi } from '@/common/api/apis/user_api'
import { AuthorityApi } from '@/common/api/apis/authority_api'
import { AuthenticationApi } from '@/common/api/apis/authentication_api'
import { AuthorizationApi } from '@/common/api/apis/authorization_api'
import { type ComponentCustomProperties } from '@vue/runtime-core'

export class ApiMediator {
  constructor(appGlobalProperties: ComponentCustomProperties) {
    const httpRequest: AxiosOperator = new AxiosOperator(
      appGlobalProperties,
      appGlobalProperties.$appConfig.apiUrl.app,
    )
    this.authentication = new AuthenticationApi(httpRequest)
    this.authorization = new AuthorizationApi(httpRequest)
    this.user = new UserApi(httpRequest)
    this.authority = new AuthorityApi(httpRequest)
  }

  public authentication: AuthenticationApi
  public authorization: AuthorizationApi
  public user: UserApi
  public authority: AuthorityApi
}
